package co.za.itweb.itwebpro;

import java.util.List;

import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class Map extends MapActivity
{
 @Override
 public void onCreate(Bundle savedInstanceState)
 {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.map);

 MapView mapView = (MapView) findViewById(R.id.mapview);
 mapView.setBuiltInZoomControls(true);

 List<Overlay> mapOverlays = mapView.getOverlays();
 Drawable drawable = this.getResources().getDrawable(R.drawable.cursor);
 HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);
 float lat = -26.060968f;
 float lng = 28.06045f;
 GeoPoint point = new GeoPoint((int)(lat * 1E6), (int)(lng * 1E6));
 
 OverlayItem overlayitem = new OverlayItem(point, "ITWeb", "POSTAL ADDRESS:\nPO Box 2785, Rivonia, 2128\nPHYSICAL ADDRESS:\n326 RivoniaBoulevard, Rivonia \nTEL: +27 11 807 3294\nFAX: +27 11 807 2020\nEMAIL:\nitnews@itweb.co.za");


 

 itemizedoverlay.addOverlay(overlayitem);


 mapOverlays.add(itemizedoverlay);
 
 MapController mapController = mapView.getController();
 mapController.setCenter(point);
 
 mapController.setZoom(15);
 
 Button closebut=(Button) findViewById(R.id.closemap);
 closebut.setOnClickListener(new OnClickListener() {
		@Override
		public void onClick(View v) {
			finish();
		}
	});
 
 
 }
 @Override
 protected boolean isRouteDisplayed()
 {
 return false;
 }
}